import { ApolloQueryResult, FetchResult, FetchPolicy } from '@apollo/client/core';
import { Observable } from 'rxjs';
/**************************************************************************************
 * 共享资源
 */
/*************************************************************************************
 * 服务接口定义
 */
export interface ShareNamesServiceApi {
  shareNames(variables: ShareNamesService_shareNamesVariables, options:ShareNamesServiceQueryOptions): Observable<ApolloQueryResult<ShareNamesService_shareNamesResult>>; // 获取共享文件
  myShareNamesList(variables: ShareNamesService_myShareNamesListVariables, options:ShareNamesServiceQueryOptions): Observable<ApolloQueryResult<ShareNamesService_myShareNamesListResult>>; // 获取当前共享的所有文件
  list(variables: ShareNamesService_listVariables, options:ShareNamesServiceQueryOptions): Observable<ApolloQueryResult<ShareNamesService_listResult>>; // 分页查询
  totalCount(): Observable<ApolloQueryResult<ShareNamesService_totalCountResult>>; // 统计库中所有对象的数据量
  search(variables: ShareNamesService_searchVariables, options:ShareNamesServiceQueryOptions): Observable<ApolloQueryResult<ShareNamesService_searchResult>>; // 游标查询
  loadAll(): Observable<ApolloQueryResult<ShareNamesService_loadAllResult>>; // 获取库中所有数据，数据量大时请谨慎使用
  getById(variables: ShareNamesService_getByIdVariables, options:ShareNamesServiceQueryOptions): Observable<ApolloQueryResult<ShareNamesService_getByIdResult>>; // 获取一个对象
  setShareNames(variables: ShareNamesService_setShareNamesVariables): Observable<FetchResult<ShareNamesService_setShareNamesResult>>; // 共享文件
  save(variables: ShareNamesService_saveVariables): Observable<FetchResult<ShareNamesService_saveResult>>; // 保存对象
  removeById(variables: ShareNamesService_removeByIdVariables): Observable<FetchResult<ShareNamesService_removeByIdResult>>; // 删除一个对象
  removeByIdList(variables: ShareNamesService_removeByIdListVariables): Observable<FetchResult<ShareNamesService_removeByIdListResult>>; // 删除一批对象
}
export interface ShareNamesServiceQueryOptions{
  cachePolicy:FetchPolicy;
  more:boolean;
}

/**
 * 获取共享文件
 */
export interface ShareNamesService_shareNamesResult{
    shareNamesService_shareNames: ShareNamesPackage;
}
export interface ShareNamesService_shareNamesVariables{
      path: string; // 文件路径
}

/**
 * 获取当前共享的所有文件
 */
export interface ShareNamesService_myShareNamesListResult{
    shareNamesService_myShareNamesList: ShareNamesConnection;
}
export interface ShareNamesService_myShareNamesListVariables{
      first: number; // 数据量
      offset: number; // 偏移量
}

/**
 * 分页查询
 */
export interface ShareNamesService_listResult{
    shareNamesService_list: ShareNamesConnection;
}
export interface ShareNamesService_listVariables{
      filter: ShareNamesFilter; // 过滤条件
      orderBy?: ShareNamesOrderBy; // 排序方式
}

/**
 * 统计库中所有对象的数据量
 */
export interface ShareNamesService_totalCountResult{
    shareNamesService_totalCount: number;
}

/**
 * 游标查询
 */
export interface ShareNamesService_searchResult{
    shareNamesService_search: ShareNamesConnection;
}
export interface ShareNamesService_searchVariables{
      first: number; // 获取数据量
      offset: number; // 获取数据起始位置
      filter: ShareNamesFilter; // 过滤条件
      orderBy?: ShareNamesOrderBy; // 排序方式
}

/**
 * 获取库中所有数据，数据量大时请谨慎使用
 */
export interface ShareNamesService_loadAllResult{
    shareNamesService_loadAll: ShareNamesConnection;
}

/**
 * 获取一个对象
 */
export interface ShareNamesService_getByIdResult{
    shareNamesService_getById: ShareNamesPackage;
}
export interface ShareNamesService_getByIdVariables{
      id: string; // 对象的ID值
}


export interface ShareNamesService_setShareNamesResult{
  shareNamesService_setShareNames: ShareNamesMutationInfo;
}

/**
 * 共享文件
 */
export interface ShareNamesService_setShareNamesVariables{
    path: string; // 文件路径
    time: number; // 共享时间,如果是0或者负数则表示不限制时间(单位毫秒)
    extractCode: boolean; // 是否需要提取码
    disclosure: boolean; // 是否完全公开(访问是否需要登陆)
}

export interface ShareNamesService_saveResult{
  shareNamesService_save: ShareNamesMutationInfo;
}

/**
 * 保存对象
 */
export interface ShareNamesService_saveVariables{
    entity: ShareNamesInput; // 保存对象，无id值新增，有id值修改，如果修改未找到对象则抛出异常修改失败
}

export interface ShareNamesService_removeByIdResult{
  shareNamesService_removeById: ShareNamesMutationInfo;
}

/**
 * 删除一个对象
 */
export interface ShareNamesService_removeByIdVariables{
    id: string; // 对象ID值
}

export interface ShareNamesService_removeByIdListResult{
  shareNamesService_removeByIdList: ShareNamesMutationInfo;
}

/**
 * 删除一批对象
 */
export interface ShareNamesService_removeByIdListVariables{
    ids: string[]; // 对象ID值列表
}
/**
 * 错误信息
 */
export interface ShareNamesErrorBody {
  message: string;
  stackTrace: string;
}

/**
 * 查询结果信息
 */
export interface ShareNamesResultInfo {
  totalCount: number;
  queryTime: number;
  sign: string;
  message: string;
}

/**
 * 分页信息
 */
export interface ShareNamesPageInfo{
  page: number;
  size: number;
  offset: number;
  endCursor: string;
  hasNextPage: boolean;
}

/**
 * 查询集合返回对象
 */
export interface  ShareNamesConnection{
  resultInfo: ShareNamesResultInfo;
  edges: ShareNamesViewEdge[];
  pageInfo: ShareNamesPageInfo;
  uuid: string;
}
export interface ShareNamesViewEdge{
  node:ShareNamesView;
}
/**
 * 查询单个对象返回结果
 */
export interface ShareNamesPackage{
  resultInfo: ShareNamesResultInfo;
  entity: ShareNamesView;
  uuid: string;
}

/**
 * 排序类型
 */
export interface ShareNamesOrderBy {
  field: string;
  type: 'ASC' | 'DESC';
}

/**
 * 更新返回结果信息
 */
export interface ShareNamesMutationInfo {
  status: boolean;
  rows: number;
  messages: string;
  uuid: string;
  sign: string;
  executeTime: number;
  result: ShareNamesView;
}

/**
 * 字符串筛选接口
 */
export interface ShareNamesStringFilter {
  eq?: string;
  neq?: string;
  like?: string;
  in?: string[];
  nin?: string[];
  gt?: string;
  lt?: string;
  gte?: string;
  lte?: string;
}

/**
 * 数字过滤条件接口
 */
export interface ShareNamesNumberFilter {
  eq?: number;
  neq?: number;
  in?: number[];
  nin?: number[];
  gt?: number;
  lt?: number;
  gte?: number;
  lte?: number;
}

/**
 * 布尔类型删选接口
 */
export interface ShareNamesBooleanFilter {
  eq?: boolean;
  neq?: boolean;
}




/*****************************************************************************************
 * 查询接口
 */
export const shareNamesServiceQuery = {
   // 获取共享文件
  shareNamesService_shareNames: `shareNamesService_shareNames(path:$path){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    entity{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    uuid
  }`
, // 获取当前共享的所有文件
  shareNamesService_myShareNamesList: `shareNamesService_myShareNamesList(first:$first,offset:$offset){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 分页查询
  shareNamesService_list: `shareNamesService_list(filter:$filter,orderBy:$orderBy){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 统计库中所有对象的数据量
  shareNamesService_totalCount: `shareNamesService_totalCount`
, // 游标查询
  shareNamesService_search: `shareNamesService_search(first:$first,offset:$offset,filter:$filter,orderBy:$orderBy){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 获取库中所有数据，数据量大时请谨慎使用
  shareNamesService_loadAll: `shareNamesService_loadAll{
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 获取一个对象
  shareNamesService_getById: `shareNamesService_getById(id:$id){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    entity{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    uuid
  }`
};

/*********************************************************************
 * 更新接口信息
 */
export const shareNamesServiceMutation = {
   // 共享文件
  shareNamesService_setShareNames: `shareNamesService_setShareNames(path:$path,time:$time,extractCode:$extractCode,disclosure:$disclosure){
    status
    rows
    messages
    uuid
    sign
    executeTime
    result{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    errorBody{
      message
      stackTrace
    }
  }`
, // 保存对象
  shareNamesService_save: `shareNamesService_save(entity:$entity){
    status
    rows
    messages
    uuid
    sign
    executeTime
    result{
      path
      namesId
      expire
      disclosure
      extractCode
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    errorBody{
      message
      stackTrace
    }
  }`
, // 删除一个对象
  shareNamesService_removeById: `shareNamesService_removeById(id:$id){
    status
    rows
    messages
    uuid
    sign
    executeTime

    errorBody{
      message
      stackTrace
    }
  }`
, // 删除一批对象
  shareNamesService_removeByIdList: `shareNamesService_removeByIdList(ids:$ids){
    status
    rows
    messages
    uuid
    sign
    executeTime

    errorBody{
      message
      stackTrace
    }
  }`
};

/************************************************************************
 * 类型信息
 */
/**
 * 共享资源
 */
export interface ShareNamesStore {
  path?: string; // 路径
  namesId?: string; // 共享资源ID
  expire?: number; // 过期时间
  disclosure?: boolean; // 公开的，不需要登陆
  extractCode?: string; // 提取码，如果为空则不需要提取码
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人名称
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: string; // 未说明
  [props: string]: any;
}
/**
 * 共享资源
 */
export interface ShareNamesView {
  path?: string; // 路径
  namesId?: string; // 共享资源ID
  expire?: number; // 过期时间
  disclosure?: boolean; // 公开的，不需要登陆
  extractCode?: string; // 提取码，如果为空则不需要提取码
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人名称
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: string; // 未说明
  [props: string]: any;
}
/**
 * 共享资源
 */
export interface ShareNamesInput {
  path?: string; // 路径
  namesId?: string; // 共享资源ID
  expire?: number; // 过期时间
  disclosure?: boolean; // 公开的，不需要登陆
  extractCode?: string; // 提取码，如果为空则不需要提取码
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人名称
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: string; // 未说明
  [props: string]: any;
}
/**
 * 共享资源
 */
export interface ShareNamesFilter {
  path?: ShareNamesStringFilter; // 路径
  namesId?: ShareNamesStringFilter; // 共享资源ID
  expire?: ShareNamesNumberFilter; // 过期时间
  disclosure?: ShareNamesBooleanFilter; // 公开的，不需要登陆
  extractCode?: ShareNamesStringFilter; // 提取码，如果为空则不需要提取码
  tenantId?: ShareNamesStringFilter; // 租户ID
  tenant?: ShareNamesStringFilter; // 租户快照信息
  tenantCode?: ShareNamesStringFilter; // 租户编号
  tenantName?: ShareNamesStringFilter; // 租户名称
  creator?: ShareNamesStringFilter; // 创建人快照信息
  creatorId?: ShareNamesStringFilter; // 创建人ID
  creatorCode?: ShareNamesStringFilter; // 创建人账号
  creatorName?: ShareNamesStringFilter; // 创建人名称
  createDateTime?: ShareNamesNumberFilter; // 创建时间
  lastModifiedDateTime?: ShareNamesNumberFilter; // 最后修改时间
  sortNum?: ShareNamesNumberFilter; // 默认排序字段
  id?: ShareNamesStringFilter; // 未说明
  [props: string]: any;
}
